#include "stdafx.h"
#include "StructureAndConst.h"
#include "DisplayController.h"
#include "GameMapTrain.h"
#include "SpriteSingleFrame.h"
#include "SpriteTime.h"
#include "..\LogicSprites\LgGameMapSpeed.h"
GameMapTrain::GameMapTrain(void)
{
}

GameMapTrain::~GameMapTrain(void)
{
}

bool GameMapTrain::ReadTheMap(LPDIRECT3DDEVICE9 pd3dDevice)
{
	m_pLgMap=new BaseLogicGameMap();
	JUDGE_POINTER_RE_FALSE(m_pLgMap)
	m_pLgMap->fGravity=fGravity;
	m_pLgMap->m_nWidth=nWidth;
	m_pLgMap->m_nHeight=nHeight;
	m_pLgMap->m_GameTime=GameTime;
	m_pLgMap->m_nPropCount=nPropCount;
	if (!GameMap::ReadTheMap(pd3dDevice)){
		return false;
	}

	LPDIRECT3DTEXTURE9 pTexture=NULL;
	CREATE_SPRITE_TIME(m_pTime,ptSPEED_TIME_NUM,picSPEED_TIME_NUM,9,true,JUDGE_POINTER_RE_FALSE)
	m_pTime->m_vPosition=pos_TIME_NUM;
	m_vecSprites.push_back(m_pTime);

	return true;
}
void GameMapTrain::DrawAllSprite(DWORD dwCurrentTime)
{
	//draw background
#ifndef TEST_COLLAPSE
	m_pBG->Draw(dwCurrentTime);
#endif
	//draw sprites
	GameMap::DrawAllSprite(dwCurrentTime);
}